#include<stdio.h>
#include<conio.h>
int convert(char key){
    if(key>='A' && key<='F')return 10+key-'A';
    else if(key>='a' && key<='f')return 10+key-'a';
    else if(key>='0' && key<='9')return key-'0';
    return -1;
}
void input(long &number,int base){
    char key;int i;
    long temp=0;
    do{
        key=getch();
        i=convert(key);
        if(i>=0 && i<base){
            temp=base*temp+i;
            printf("%c",key);
        }
    }while(key!=13);
    printf("\n");
    number=temp;
}
int main(){
    long a;
    input(a,2);
    printf("%ld",a);
    getch();
    return 0;
}
        
        
        
